import Vuex from "vuex";
import Vue from "vue";

Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        num:1
    },
    mutations:{
        changeNum(state,payload){
            state.num += payload.num
        }
    },
    actions:{
        changeNumAwait({commit},obj){
            setTimeout(()=>{
                commit('changeNum',obj)
            },1000)
        }
    }
})